
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>支付界面</title>
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css"
          integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">

    <link rel="stylesheet" href="./css/fileinput.min.css">

    <script src="http://code.jquery.com/jquery-3.7.0.min.js"></script>

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js"
            integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd"
            crossorigin="anonymous"></script>
    <script src="./js/fileinput.min.js"></script>

    <style>
        th,td{ text-align: center}
    </style>
</head>
<style>

    .a{
        position: absolute;
        left:10%;
        top:10%;
    }
    .b{
        position: absolute;
        left:10%;
        top:50%;
    }
    input {
        width: 200%;
        height: 30px;
    }
    p {font-size:20px;}
</style>
<body>
<!-- 导航  开始 -->
<div class="row">
    <div class="col-md-1"></div>
    <div class="col-md-10">
        <nav class="navbar navbar-default" role="navigation">
            <div class="container-fluid">
                <div class="navbar-header">
                    <a class="navbar-brand" href="#">商品购物管理</a>
                </div>
                <div>
                    <%-- <br><br>--%>
                    <!--向左对齐-->
                    <ul class="nav navbar-nav navbar-left">
                        <li class="dropdown">
                            <a href="home2.jsp" class="dropdown-toggle" >
                                首页
                                <b class="caret"></b>
                            </a>
                        </li>
                        <li class="dropdown">
                            <a href="shopping2.jsp" class="dropdown-toggle" >商品</a>
                        </li>
                        <li class="dropdown">
                            <a href="buyerregister.jsp" class="dropdown-toggle" >注册</a>
                        </li>
                        <li class="dropdown">
                            <a href="buyerlogin.jsp" class="dropdown-toggle" >登录</a>
                        </li>
                        <li class="dropdown">
                            <a href="login.html" class="dropdown-toggle" >后台管理</a>
                        </li>
                    </ul>
                    <!--向右对齐 -->
                    <ul class="nav navbar-nav navbar-right">
                    </ul>
                </div>
            </div>
        </nav>
    </div>
    <div class="col-md-1"></div>
</div>
<!-- 导航  结束 -->
<div class="a">
    <h1>确认收货信息</h1>
    <b>收货人员：</b>><input type="text" id="buyername"style="margin-bottom:18px;"><br>
    <b>收货电话：</b><input type="text" id="buyernum"style="margin-bottom:18px;"><br>
    <b>收货地址：</b><input type="text" id="buyerplace"style="margin-bottom:18px;"><br>
</div>
<br>
<br>
<div class="b">
    <h1>选择支付方式</h1><br>
    <p>订单编号：</p><br>
    <img src="images/wx.png" alt="wx" width="175" onclick="updateOrdersName()">
    <img src="images/zfb.png" alt="zfb" width="300" onclick="updateOrdersName()">
    <img src="images/yl.jpg" alt="yl" width="200" onclick="updateOrdersName()">


</div>
</body>
<script>
    $("#buyername").val(<%=session.getAttribute("buyername")%>);
    $("#buyernum").val(<%=session.getAttribute("buyernum")%>);
    $("#buyerplace").val(<%=session.getAttribute("buyerplace")%>);
</script>

<script>
    function updateOrdersName() {
        /* //获取修改之后的信息
         var id = $("#id2").val();
         var oredersname = $("#oredersname2").val();
         var password = $("#password2").val();
         var avatar = $("#avatar2").val();
         var createdate = $("#createdate2").val();*/
        var oname ='<%=session.getAttribute("buyername")%>'.toString();

        //组装数据
        /*var obj = {};
        obj.id = id;
        obj.oredersname = oredersname;
        obj.password = password;*/

        $.ajax
        (
            {
                url: "/Test/orders?method=updateOrdersName",//请求路径
                data: {oname:oname},//请求数据
                type: "post",//请求方式 GET/POST/ PUT/DELETE
                //dataType: "json",//请求数据类型
                //contentType: "application/json",//返回数据类型
                success: function (data) {
                    console.log(data);
                    data = JSON.parse(data);//把后台的数据处理为json格式
                    if (data.code == "0000") {

                      alert("支付成功！");
                        location.href="paysuc.jsp";

                    } else {
                        alert("修改失败！");
                    }
                }
            }
        )

    }
</script>
</html>
